/**
 * 
 */
package com.taobao.wolfwolf.hibernate.service.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.SitemDao;
import com.taobao.wolfwolf.hibernate.pojo.Sitem;
import com.taobao.wolfwolf.hibernate.service.SitemService;

/**
 * @author Tux
 *
 * 创建时间: 2011-5-20 上午09:54:26
 */
public class SitemServiceImpl extends BaseServiceImpl implements SitemService {
	private SitemDao sdao;

	public List<Sitem> findAll() {
		try {
			return sdao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Sitem findById(int id) {
		try {
			return sdao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}

	public List<Sitem> findByName(String name) {
		try {
			return sdao.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
		}
		return null;
	}

	public long getTotal()  {
		try {
			return sdao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public List<Sitem> paging(int page, int limit)  {
		try {
			return sdao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
		}
		return null;
	}

	public List<Sitem> findByPinyin(String abbr) {
		try {
			return sdao.findByPinyin(abbr);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByPinyin(String abbr)");
		}
		return null;
	}

	public SitemDao getSdao() {
		return sdao;
	}

	public void setSdao(SitemDao sdao) {
		this.sdao = sdao;
	}
}
